home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1996-01-19 | 3.5 KB | 101 lines |
- ' ************************************* Commands used:
- ' * * Limit Smouse =Pjoy
- ' * Amcaf Examples * =X Smouse Smouse X
- ' * GamePorts V1.3 * =Y Smouse Smouse Y
- ' * Written by Chris Hodges * =Smouse Key
- ' * * =Xfire
- ' ************************************* Smouse Speed
- '
- ' NOTE: Requires lowlevel.library for all functions!
- ' If two joysticks are 'yellow', a printer is connected instead
- ' of a four player adapter.
- '
- ' Check for lowlevel.library:
- Trap DUMMY= Extension_8_15BE(0,2)
- If Errtrap Then LOWLEVEL=0 Else LOWLEVEL=1
- ' First open a screen for the graphics.
- Screen Open 0,320,200,32,0
- Curs Off : Flash Off : Paper 0 : Pen 1 : Cls
- Wait Vbl
- ' Now create the icon mask and load the correct palette
- Make Icon Mask
- Get Icon Palette
- ' Limit the two mice to the screen
- Limit Mouse
- Extension_8_159C
- ' Center the second mouse to the middle of the screen
- Extension_8_1558 X Hard(160) : Extension_8_1568 Y Hard(100)
- ' Set the second mouse to the same speed it's in AMOS.
- Extension_8_1578 1
- ' Draw the four controllers
- X=64 : Y=16 : Paste Icon X,Y,1
- X=24 : Y=84 : Paste Icon X,Y,2
- X=216 : Y=16 : Paste Icon X,Y,1
- X=176 : Y=84 : Paste Icon X,Y,2
- Pen 31 : Paper 0 : Print " Port 0 Port 1"
- ' Turn on double buffering for a flicker free display
- Double Buffer : Autoback 0
- ' Main loop
- Repeat
- ' Be system conform. No need to waste processor time.
- Screen Swap : Multi Wait
- ' Draw the second mouse sprite.
- Sprite 1, Extension_8_153C , Extension_8_154A ,1
- ' Check mouse ones buttons first.
- MK=Mouse Key : X=64 : Y=16 : Gosub DRAMOUSEBUTS
- ' Draw port zeros joypads buttons
- P=0 : X=24 : Y=84 : Gosub DRAPADBUTS
- ' Now check mouse two
- MK= Extension_8_158C : X=216 : Y=16 : Gosub DRAMOUSEBUTS
- ' And port ones buttons on the joypad
- P=1 : X=176 : Y=84 : Gosub DRAPADBUTS
- ' At last, all four joysticks
- P=Joy(0) : X=16 : Y=132 : Gosub DRAJOYSTICK
- P= Extension_8_08E0(0) : X=96 : Y=132 : Gosub DRAJOYSTICK
- P=Joy(1) : X=176 : Y=132 : Gosub DRAJOYSTICK
- P= Extension_8_08E0(1) : X=256 : Y=132 : Gosub DRAJOYSTICK
- Until Inkey$=Chr$(27)
- Sprite Off
- Screen Close 0
- End
- DRAMOUSEBUTS:
- ' Left Button
- Paste Icon X+4,Y+16,3+(MK and 1)
- ' Right Button
- Paste Icon X+13,Y+16,3+(MK and 4)/4
- ' Middle Button
- Paste Icon X+22,Y+16,3+(MK and 2)/2
- Return
- DRAPADBUTS:
- ' Red fire button (normal fire button)
- Paste Icon X+92,Y+24,5- Extension_8_15BE(P,0)
- ' Blue (second) fire button
- Paste Icon X+103,Y+22,7- Extension_8_15BE(P,1)
- ' The other buttons require the lowlevel.library
- If LOWLEVEL=0 Then Return
- ' Green fire button. Joypad only.
- Paste Icon X+101,Y+12,9- Extension_8_15BE(P,2)
- ' Yellow fire button. Joypad only.
- Paste Icon X+90,Y+14,11- Extension_8_15BE(P,3)
- ' Rewind button. Joypad only.
- Ink 0 : Bar X+9,Y To X+20,Y+3
- Paste Icon X+6,Y-1,15- Extension_8_15BE(P,4)
- ' Forward button. Joypad only
- Ink 0 : Bar X+94,Y To X+106,Y+3
- Paste Icon X+83,Y-1,17- Extension_8_15BE(P,5)
- ' Pause button. Joypad only.
- Paste Icon X+57,Y+32,13- Extension_8_15BE(P,6)
- Return
- DRAJOYSTICK:
- ' Clear the old region
- Ink 0 : Bar X-16,Y To X+63,Y+67
- ' Icon for no movement
- I=19
- ' Check four directions
- If P and 1 Then I=20
- If P and 2 Then I=21
- If P and 4 Then I=23 : Add X,-16
- If P and 8 Then I=22
- ' Paste the icon and check for fire button
- Paste Icon X,Y,I-((P and 16)<>0)*5
- Return